LOCAL_PATH:= $(call my-dir)

#----------------------
# Memory lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-memory
LOCAL_SRC_FILES := Memory.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# disk lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-disk
LOCAL_SRC_FILES := Disk.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# diskimage lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-diskimage
LOCAL_SRC_FILES := DiskImage.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# joystick lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-joystick
LOCAL_SRC_FILES := Joystick.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# keyboard lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-keyboard
LOCAL_SRC_FILES := Keyboard.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# save state lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-savestate
LOCAL_SRC_FILES := SaveState.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# Speaker lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-speaker
LOCAL_SRC_FILES := Speaker.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# wwrapper lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-wwrapper
LOCAL_SRC_FILES := wwrapper.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# video lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-video
LOCAL_SRC_FILES := Video.cpp

include $(BUILD_STATIC_LIBRARY)

#----------------------
# cpu lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-cpu
LOCAL_SRC_FILES := CPU.cpp

include $(BUILD_STATIC_LIBRARY)


#----------------------
# main lib, which will depend on and include the others
#
include $(CLEAR_VARS)

LOCAL_DEFAULT_CPP_EXTENSION := cpp

LOCAL_MODULE    := candyapple-main
LOCAL_SRC_FILES := CACore.cpp
LOCAL_LDLIBS := -llog

LOCAL_STATIC_LIBRARIES := candyapple-video candyapple-disk candyapple-cpu candyapple-speaker candyapple-memory candyapple-diskimage candyapple-joystick candyapple-keyboard candyapple-wwrapper candyapple-savestate

include $(BUILD_SHARED_LIBRARY)
